package com.yz.fanrenmianshi.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yz.fanrenmianshi.model.dto.questioncomment.QuestionCommentQueryRequest;
import com.yz.fanrenmianshi.model.entity.QuestionComment;
import com.yz.fanrenmianshi.model.vo.QuestionCommentVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 题目评论服务
 *
 */
public interface QuestionCommentService extends IService<QuestionComment> {

    /**
     * 校验数据
     *
     * @param questionComment
     * @param add 对创建的数据进行校验
     */
    void validQuestionComment(QuestionComment questionComment, boolean add);

    /**
     * 获取查询条件
     *
     * @param questionCommentQueryRequest
     * @return
     */
    QueryWrapper<QuestionComment> getQueryWrapper(QuestionCommentQueryRequest questionCommentQueryRequest);
    
    /**
     * 获取题目评论封装
     *
     * @param questionComment
     * @param request
     * @return
     */
    QuestionCommentVO getQuestionCommentVO(QuestionComment questionComment, HttpServletRequest request);

    /**
     * 分页获取题目评论封装
     *
     * @param questionCommentPage
     * @param request
     * @return
     */
    Page<QuestionCommentVO> getQuestionCommentVOPage(Page<QuestionComment> questionCommentPage, HttpServletRequest request);

    /**
     * 批量删除题目评论
     * @param questionCommentIdList
     * @return
     */
    void batchDeleteQuestions(List<Long> questionCommentIdList);

    /**
     * 级联删除题目评论（删除评论及其所有子评论）
     * @param commentId
     * @return
     */
    void cascadeDeleteComment(Long commentId);
}
